import java.util.Scanner;

public class commondivisor {
    public static void main(String[] args) {
        System.out.println("请输入两个数：");
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = a%b;
        while(c!=0){
            a = b;
            b = c;
            c = a%b;
        }
        System.out.println("两个数的公约数是"+b);
    }
}
